
<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>麦知网——学问有余，可为人师</title>
   	<link href="../../css/bootstrap.css" rel="stylesheet">
    <link href="../../css/non-responsive.css" rel="stylesheet">
    <link href="../../css/font-awesome.min.css" rel="stylesheet">
    <link href="../../css/topicCreate2.css" rel="stylesheet">
    <link href="../../css/topicCreate.css" rel="stylesheet">
    <link href="../../ico/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon"/>
    <link href="../../css/sco.message.css" rel="stylesheet">
	<link href="../../css/scojs.css" rel="stylesheet">
    <script src="../../js/jquery.min.js"></script>
	<script src="../../js/bootstrap.js"></script>
	<script src="../../js/textEditor2.js"></script>
	<script src="../../js/textEditor.js"></script>
	<script src="../../js/sco.message.js"></script>
	<script src="../../js/publish_topic.js"></script>
	<script src="../../js/logout.js"></script>
  </head>
  <body>
{% include 'public/common/header.html' %}
<div class="container" style="margin-top:45px">
	<div class="row">
		<div class="col-xs-12">
			<div>
				<div class="pull-left group_img"><img src="{{group.domain}}/{{group.img}}" width="100%"/></div>
				<div class="pull-left group_name">
					<div class="group_nam"><b>{{group.name}}</b></div>
					<div class="return_group"><a href="{% url 'groups:thegroup' group.id %}"><span class="glyphicon glyphicon-arrow-left"></span> 返回小组</a></div>
				</div>
				<div class="clearfix"></div>
			</div>
			<div class="topdirection"></div>
			
			<div>
				<div class="topic_title">
					<input class="form-control" id="title" type="text" placeholder="在此填写话题题目..." maxlength="20"> 
				</div>
				<div class="textEditor_WTF">
					
						<div class="btn-toolbar" data-role="editor-toolbar" data-target="#editor" style="width:100%;">
					      
					      <div class="btn-group">
					        <a class="btn dropdown-toggle" data-toggle="dropdown" title="字体大小"><i class="icon-text-height"></i>&nbsp;<b class="caret"></b></a>
					          <ul class="dropdown-menu">
					          <li><a data-edit="fontSize 5"><font size="5">大</font></a></li>
					          <li><a data-edit="fontSize 3"><font size="3">正常</font></a></li>
					          <li><a data-edit="fontSize 1"><font size="1">小</font></a></li>
					          </ul>
					      </div>
					      <div class="btn-group">
					        <a class="btn" data-edit="bold" title="加粗 (Ctrl/Cmd+B)"><i class="icon-bold"></i></a>
					        <a class="btn" data-edit="italic" title="斜体 (Ctrl/Cmd+I)"><i class="icon-italic"></i></a>
					        <a class="btn" data-edit="strikethrough" title="删除线"><i class="icon-strikethrough"></i></a>
					        <a class="btn" data-edit="underline" title="下划线 (Ctrl/Cmd+U)"><i class="icon-underline"></i></a>
					      </div>
					      <div class="btn-group">
					        <a class="btn" data-edit="insertunorderedlist" title="无序列表"><i class="icon-list-ul"></i></a>
					        <a class="btn" data-edit="insertorderedlist" title="有序列表"><i class="icon-list-ol"></i></a>
					        <a class="btn" data-edit="outdent" title="减少缩进  (Shift+Tab)"><i class="icon-indent-left"></i></a>
					        <a class="btn" data-edit="indent" title="增加缩进 (Tab)"><i class="icon-indent-right"></i></a>
					      </div>
					      <div class="btn-group">
					        <a class="btn" data-edit="justifyleft" title="左端对齐 (Ctrl/Cmd+L)"><i class="icon-align-left"></i></a>
					        <a class="btn" data-edit="justifycenter" title="居中 (Ctrl/Cmd+E)"><i class="icon-align-center"></i></a>
					        <a class="btn" data-edit="justifyright" title="右端对齐 (Ctrl/Cmd+R)"><i class="icon-align-right"></i></a>
					        <a class="btn" data-edit="justifyfull" title="自适应 (Ctrl/Cmd+J)"><i class="icon-align-justify"></i></a>
					      </div>
					      <div class="btn-group">
							  <a class="btn dropdown-toggle" data-toggle="dropdown" title="添加超链"><i class="icon-link"></i></a>
							  <div class="dropdown-menu input-append">
								    <input class="span2" placeholder="URL" type="text" data-edit="createLink"/>
								    <button class="btn" type="button">添加</button>
					          </div>
					        <a class="btn" data-edit="unlink" title="移除超链"><i class="icon-cut"></i></a>
					      </div>
					      <div class="btn-group">
					        <a class="btn" title="添加图片 (或者直接拖拽)" id="pictureBtn"><i class="icon-picture"></i></a>
					        <input type="file" data-role="magic-overlay" data-target="#pictureBtn" data-edit="insertImage" />
					      </div>
					      <input type="text" data-edit="inserttext" id="voiceBtn" x-webkit-speech="">
					    </div>
					    <div id="editor" style="width:100%;">
					     	 请在此填写话题内容（可添加图片）&hellip;
					    </div>
					   
					   
				</div>
				
				<div class="topic_btn">
					<button type="button" onclick="publish({{group.id}})" class="btn btn-warning btn-lg btn-block">发布新话题</button>
				</div>
			</div>
			
		   
			
		</div>
 	</div>
</div>


<script>
  $(function(){
    function initToolbarBootstrapBindings() {
      var fonts = ['Serif', 'Sans', 'Arial', 'Arial Black', 'Courier', 
            'Courier New', 'Comic Sans MS', 'Helvetica', 'Impact', 'Lucida Grande', 'Lucida Sans', 'Tahoma', 'Times',
            'Times New Roman', 'Verdana'],
            fontTarget = $('[title=Font]').siblings('.dropdown-menu');
      $.each(fonts, function (idx, fontName) {
          fontTarget.append($('<li><a data-edit="fontName ' + fontName +'" style="font-family:\''+ fontName +'\'">'+fontName + '</a></li>'));
      });
      $('a[title]').tooltip({container:'body'});
    	$('.dropdown-menu input').click(function() {return false;})
		    .change(function () {$(this).parent('.dropdown-menu').siblings('.dropdown-toggle').dropdown('toggle');})
        .keydown('esc', function () {this.value='';$(this).change();});

      $('[data-role=magic-overlay]').each(function () { 
        var overlay = $(this), target = $(overlay.data('target')); 
        overlay.css('opacity', 0).css('position', 'absolute').offset(target.offset()).width(target.outerWidth()).height(target.outerHeight());
      });
      $('#voiceBtn').hide();
      // if ("onwebkitspeechchange"  in document.createElement("input")) {
      //   var editorOffset = $('#editor').offset();
      //   $('#voiceBtn').css('position','absolute').offset({top: editorOffset.top, left: editorOffset.left+$('#editor').innerWidth()-35});
      // } else {
      //   $('#voiceBtn').hide();
      // }
    };
    initToolbarBootstrapBindings();  
    $('#editor').wysiwyg();
    window.prettyPrint && prettyPrint();
  });
</script>

<!--<script src="/p/projects.js"></script>-->
</body>
</html>
